﻿<%@ Page Title="Register Login" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="~/Login.aspx.cs" Inherits="Cotrobaie.Login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<div id="headerMiddle">
	<div id="logo1">
        <asp:ImageButton ID="ImageButton6" runat="server"  ImageUrl="~/images/logomic.png" OnClick="goHome"/>
	</div>			    
</div>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="choices" >
        <div id="popitems" style="" class="choices">
            <asp:ImageButton ID="ButtonRegister" runat="server"  ImageUrl="~/images/register.png" OnClick="tabClick" />
        </div>
        <div id="recommitems" style="z-index:-10">
            <asp:ImageButton ID="ButtonLogin" runat="server"  ImageUrl="~/images/login.png" OnClick="tabClick" />
        </div>
    </div>

<div id="bigBulina">
        <asp:Image ID="Image1" runat="server" ImageUrl="~/images/biggreeen.png"/>
        <div runat="server" id="contentBigBulina" class="contentBigBulina" style="text-align:left; top:180px; left:300px; color:White">

    <div id="pageTitle" class="pageTitle" style="position:relative; left:5px; width:500px">REGISTER - LOGIN</div>
    <span id="signupform" runat="server">
        <table cellspacing="5px" >
            <tr> <td align="left" style="color:#272727; font-weight:600; height:25px; " colspan="2">CREATE NEW ACCOUNT </td> <td> &nbsp;</td></tr>
            <tr> <td align="left" colspan="2"> <hr style="width:270px; color:#d2d2d2"/></td></tr>
            <tr> <td> &nbsp;</td></tr>
            <tr>
                <td align="left">
                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="TextBoxUserName">Username</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxUserName" runat="server" BorderWidth="1" BorderColor="#d2d2d2"
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" MaxLength="30" ValidationGroup="GrupInregBona"
                        ontextchanged="UsernameBone_TextChanged" AutoPostBack="true"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="RFVUsernameBone" runat="server" 
                        ControlToValidate="TextBoxUserName" 
                        ErrorMessage="Campul Nume utilizator este obligatoriu"  Text="<blink style='color:red;'>*</blink>"
                        ValidationGroup="GrupInregBona" SetFocusOnError="True" Display="Dynamic"/>
                    <asp:RegularExpressionValidator ID="REVUsernameBone" runat="server" 
                        ErrorMessage="Campul Nume utilizator este incorect (trebuie sa contina doar litere si cifre si o dimensiune intre 2 si 30 caractere)" 
                        Text="<blink style='color:red;'>*</blink>" ValidationGroup="GrupInregBona" 
                        ControlToValidate="TextBoxUserName" SetFocusOnError="true" Display="Dynamic" 
                        ValidationExpression="[a-zA-Z0-9._]{2,30}"/>
                    <asp:CustomValidator ID="CuVUsernameBone" runat="server" ControlToValidate="TextBoxUserName"
                        ErrorMessage="Username deja existent. Va rugam alegeti altul" 
                        Text="<blink style='color:red;'>*</blink>" Display="Dynamic" 
                        SetFocusOnError="True" ValidationGroup="GrupInregBona"/>
                    <asp:CustomValidator ID="CustomValidator2" runat="server" ControlToValidate="TextBoxUserName"
                        ErrorMessage="" Text="<blink style='color:red;'>*</blink>" Display="Dynamic"
                        SetFocusOnError="True" ValidationGroup="GrupInregBona"/>
                </td>
            </tr>

            <tr>
                <td align="left">
                    <asp:Label ID="LabelNume" runat="server" Text="Surname" AssociatedControlID="TextBoxNume" ></asp:Label>
                </td> 
                <td>
                    <asp:TextBox ID="TextBoxNume" runat="server" BorderWidth="1" BorderColor="#d2d2d2" 
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" MaxLength="50" AutoCompleteType="LastName" ValidationGroup="GrupInregBona"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="RFVNumeBona" runat="server" 
                        ControlToValidate="TextBoxNume" ErrorMessage="Campul Nume este obligatoriu"  Text="<blink style='color:#ff5b02;'>*</blink>"
                        ValidationGroup="GrupInregBona" SetFocusOnError="True" Display="Dynamic"/>
                    <asp:RegularExpressionValidator ID="REVNumeBona" runat="server" 
                        ErrorMessage="Campul Nume este incorect (trebuie sa contina numai litere si o dimensiune intre 2 si 50 de caractere)" 
                        Text="<blink style='color:#ff5b02;'>*</blink>" ValidationGroup="GrupInregBona" 
                        ControlToValidate="TextBoxNume" SetFocusOnError="true" Display="Dynamic" 
                        ValidationExpression="[a-zA-Z- ]{2,50}"/>
                </td>  
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="LabelPrenume" runat="server" Text="First Name" AssociatedControlID="TextBoxPrenume"></asp:Label>
                </td> 
                <td>
                    <asp:TextBox ID="TextBoxPrenume" runat="server" BorderWidth="1" BorderColor="#d2d2d2"
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" MaxLength="50" AutoCompleteType="FirstName" ValidationGroup="GrupInregBona"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="RFVPrenumeBona" runat="server" 
                        ControlToValidate="TextBoxPrenume" 
                        ErrorMessage="Campul Prenume este obligatoriu"  Text="<blink style='color:#ff5b02;'>*</blink>"
                        ValidationGroup="GrupInregBona" SetFocusOnError="True" Display="Dynamic"/>
                    <asp:RegularExpressionValidator ID="REVPrenumeBona" runat="server" 
                        ErrorMessage="Campul Prenume este incorect (trebuie sa contina numai litere si o dimensiune intre 2 si 50 de caractere)" 
                        Text="<blink style='color:#ff5b02;'>*</blink>" ValidationGroup="GrupInregBona" 
                        ControlToValidate="TextBoxPrenume" SetFocusOnError="true" Display="Dynamic" 
                        ValidationExpression="[a-zA-Z- ]{2,50}"/>
                </td> 
            </tr>

            <tr>
                <td align="left">
                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="TextBoxEmail">E-mail </asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxEmail" runat="server" BorderWidth="1" BorderColor="#d2d2d2"
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" MaxLength="50" AutoCompleteType="Email" ValidationGroup="GrupInregBona" OnTextChanged="UsernameBone_TextChanged" AutoPostBack="True"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="RFVEmailBona" runat="server" 
                        ControlToValidate="TextBoxEmail" 
                        ErrorMessage="Campul Adresa E-mail este obligatoriu"  Text="<blink style='color:#ff5b02;'>*</blink>"
                        ValidationGroup="GrupInregBona" SetFocusOnError="True" Display="Dynamic"/>
                    <asp:RegularExpressionValidator ID="REVEmailBona" runat="server" 
                        ErrorMessage="Campul Adresa E-mail este incorect" 
                        Text="<blink style='color:#ff5b02;'>*</blink>" ValidationGroup="GrupInregBona" 
                        ControlToValidate="TextBoxEmail" SetFocusOnError="true" Display="Dynamic" 
                        ValidationExpression="^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,4})$"/>
                    <asp:CustomValidator ID="CuVEmailBona" runat="server" ControlToValidate="TextBoxEmail"
                        ErrorMessage="Adresa de E-mail exista deja in baza noastra de date. <br>Daca ati uitat numele de utilizator sau parola <br>puteti accesa pagina de <a href='RecuperareParola.aspx'>recuperare a parolei</a>" 
                        Text="<blink style='color:red;'>*</blink>" Display="Dynamic"
                        SetFocusOnError="True" ValidationGroup="GrupInregBona"/>
                </td>
            </tr>

            <tr>
                <td align="left">
                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="TextBoxParola">Password </asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxParola" runat="server" BorderWidth="1" BorderColor="#d2d2d2" 
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" MaxLength="50" TextMode="Password" ValidationGroup="GrupInregBona"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="RFVParola" runat="server"
                        ControlToValidate="TextBoxParola" 
                        ErrorMessage="Campul Parola este obligatoriu"  Text="<blink style='color:#ff5b02;'>*</blink>"
                        ValidationGroup="GrupInregBona" SetFocusOnError="True" Display="Dynamic"/>
                    <asp:RegularExpressionValidator ID="REVParola" runat="server" 
                        ErrorMessage="Campul Parola trebuie sa contina minim 6 caractere" 
                        Text="<blink style='color:#ff5b02;'>*</blink>" ValidationGroup="GrupInregBona" 
                        ControlToValidate="TextBoxParola" SetFocusOnError="true" Display="Dynamic" 
                        ValidationExpression="^^[\w\W]{6,50}$"/>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Label ID="PasswordHint" runat="server" Text="(min 6 characters)"
                        Font-Size="XX-Small" ForeColor="white"></asp:Label>
                                  
                </td>
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="TextBoxConfirmPassword">Confirm  </asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxConfirmPassword" runat="server" BorderWidth="1" BorderColor="#d2d2d2" 
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" MaxLength="50" TextMode="Password" ValidationGroup="GrupInregBona"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="REVParola2" runat="server"
                        ControlToValidate="TextBoxConfirmPassword" 
                        ErrorMessage="Campul Parola este obligatoriu"  Text="<blink style='color:#ff5b02;'>*</blink>"
                        ValidationGroup="GrupInregBona" SetFocusOnError="True" Display="Dynamic"/>
                    <asp:CompareValidator ID="CVParola2Bona" runat="server"
                        ErrorMessage="Nepotrivire Parole" ControlToCompare="TextBoxParola" 
                        ControlToValidate="TextBoxConfirmPassword" SetFocusOnError="True" 
                        Text="<blink style='color:#ff5b02;'>*</blink>" ValidationGroup="GrupInregBona" 
                        Display="Dynamic"></asp:CompareValidator>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="CapchaLabel" runat="server" AssociatedControlID="TextBoxCapcha">Capcha Code  </asp:Label>
                </td>
                <td>
                    <iframe frameborder="0" scrolling="no" width="180px" height="50" src="CaptchaImage/CapchaButton.aspx"></iframe>
                </td>
             </tr>
             <tr>
                <td>&nbsp;</td>
                <td>    
                    <asp:TextBox ID="TextBoxCapcha" runat="server" BorderWidth="1" BorderColor="#d2d2d2" 
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" MaxLength="50" ValidationGroup="GrupInregBona"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                        ControlToValidate="TextBoxCapcha" 
                        ErrorMessage="Capcha Code este obligatoriu"  Text="<blink style='color:#ff5b02;'>*</blink>"
                        ValidationGroup="GrupInregBona" SetFocusOnError="True" Display="Dynamic"/>
                    <asp:CustomValidator ID="CVCodVerificare" runat="server" 
                        ErrorMessage="Codul Captcha este gresit" Text="<blink style='color:#ff5b02;'>*</blink>" 
                        Display="Dynamic" SetFocusOnError="True" 
                        ValidationGroup="GrupInregBona"/>
                </td>
            </tr>
        
            <tr><td>&nbsp;</td></tr>
            <tr>
                <td align="center" colspan="2" style="color:#ff5b02;">
                    <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                </td>
            </tr>
            <tr><td>
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                    HeaderText="Trebuie sa completati corect urmatoarele campuri: " 
                    ShowMessageBox="True" ShowSummary="False" 
                    ValidationGroup="GrupInregBona" />
            </td></tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="ButtonSignupForm" runat="server" Text="Create account" CssClass="bigbutton"
                     ValidationGroup="GrupInregBona" Width="150px" 
                        onclick="ButtonSignupForm_Click" />
                </td>
            </tr>
        </table>
    </span>

    <span id="loginform" runat="server" class="loginform" visible="false">
        <table cellspacing="5px" >
            <tr> <td align="left" style="color:#272727; font-weight:600; height:25px; " colspan="2">ALREADY REGISTERED </td> <td> &nbsp;</td></tr>
            <tr> <td align="left" colspan="2"> <hr style="width:270px; color:#d2d2d2"/></td></tr>
            <tr> <td> &nbsp;</td></tr>
            <tr>
                <td align="left">
                    <asp:Label ID="LabelUserLogin" runat="server" AssociatedControlID="TextBoxUserLogin">Username</asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxUserLogin" runat="server" BorderWidth="1" BorderColor="#d2d2d2" 
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" ValidationGroup="GrupLoginBona" MaxLength="30"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="TextBoxUserLogin" 
                        ErrorMessage="Campul Nume utilizator este obligatoriu"  Text="<blink style='color:#ff5b02;'>*</blink>"
                        ValidationGroup="GrupLoginBona" SetFocusOnError="True" Display="Dynamic"/>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ErrorMessage="Campul Nume utilizator este incorect (trebuie sa contina doar litere si cifre si o dimensiune intre 2 si 30 caractere)" 
                        Text="<blink style='color:#ff5b02;'>*</blink>" ValidationGroup="GrupLoginBona" 
                        ControlToValidate="TextBoxUserLogin" SetFocusOnError="true" Display="Dynamic" 
                        ValidationExpression="[a-zA-Z0-9._]{2,30}"/>
                    <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="TextBoxUserLogin" 
                        ErrorMessage="" Text="<blink style='color:#ff5b02;'>*</blink>" Display="Dynamic" 
                        SetFocusOnError="True" ValidationGroup="GrupInregBona"/>
                </td>
            </tr>
            <tr><td>&nbsp;</td></tr>
            <tr>
                <td align="left">
                    <asp:Label ID="LabelPasLogin" runat="server" AssociatedControlID="TextBoxPasLogin" >Password </asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBoxPasLogin" runat="server" TextMode="Password" BorderWidth="1" BorderColor="#d2d2d2" 
                        BorderStyle="Solid" Height="20" ForeColor="#707070" Width="180px" ValidationGroup="GrupLoginBona" MaxLength="50"></asp:TextBox>&nbsp;
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                        ControlToValidate="TextBoxPasLogin" 
                        ErrorMessage="Campul Parola este obligatoriu"  Text="<blink style='color:#ff5b02;'>*</blink>"
                        ValidationGroup="GrupLoginBona"  SetFocusOnError="True" Display="Dynamic"/>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                        ErrorMessage="Campul Parola trebuie sa contina minim 6 caractere" 
                        Text="<blink style='color:#ff5b02;'>*</blink>" ControlToValidate="TextBoxPasLogin"
                        ValidationGroup="GrupLoginBona"  SetFocusOnError="true" Display="Dynamic" 
                        ValidationExpression="^^[\w\W]{6,50}$"/>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2" style="color:#ff5b02;">
                    <asp:Literal ID="Literal1" runat="server" EnableViewState="False"></asp:Literal>
                </td>
            </tr>
            <tr><td>&nbsp;</td></tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="ButtonLog" runat="server" Text="Login" CssClass="bigbutton"  
                        Width="100px" ValidationGroup="GrupLoginBona" onclick="ButtonLogin_Click" />
                </td>
            </tr>
            <tr><td>
                <asp:ValidationSummary ID="ValidationSummary2" runat="server" 
                    HeaderText="Trebuie sa completati corect urmatoarele campuri: " 
                    ShowMessageBox="True" ShowSummary="False" 
                    ValidationGroup="GrupLoginBona" />
            </td></tr>
            <tr>
                <td colspan="2">
                    <asp:HyperLink ID="HyperLinkForgot" runat="server" CssClass="blgrlink" NavigateUrl="~/RecuperareParola.aspx">Forgot my password</asp:HyperLink>
                </td>
            </tr>
        </table>
    </span>
     <span id="RegisterOk" runat="server" visible="false">
        <table cellspacing="5px" style="text-align:center;vertical-align:middle;">
            <tr align="center" valign="middle">
                <td align="center" valign="middle" id="Mesaj" runat="server"></td>
            </tr>
        </table>
    </span>

    </div></div>
</asp:Content>
